/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  							 script_player_action.cpp

	$Header: /heroes4/script_player_action.cpp $

	$NoKeywords: $

 ************************************************************************/

// kill the 255+ character identifier warning.  Templates tend to exceed that easily.
#include "precompiled.h"
#pragma warning( disable: 4786 )

#include "script_player_action.h"

#include "creature_array.h"
#include "player.h"
#include "script_targeting.h"

void t_script_player_action::execute(t_script_context_hero const& context) const
{
	t_player* player = select_player_by_target(get_target(), context.map, NULL, context.army_owner, context.opposing_army_owner);
	if (player)
		do_action( context.map, player );
}

void t_script_player_action::execute(t_script_context_town const& context) const
{
	t_player* player = select_player_by_target(get_target(), context.map, context.object, context.garrison ? context.garrison->get_owner() : NULL, context.opposing_army_owner);
	if (player)
		do_action( context.map, player );
}

void t_script_player_action::execute(t_script_context_object const& context) const
{
	t_player* player = select_player_by_target(get_target(), context.map, NULL, NULL, NULL);
	if (player)
		do_action( context.map, player );
}

void t_script_player_action::execute(t_script_context_army const& context) const
{
	t_player* player = select_player_by_target(get_target(), context.map, NULL, context.army_owner, context.opposing_army_owner);
	if (player)
		do_action( context.map, player );
}

void t_script_player_action::execute(t_script_context_global const& context) const
{
	t_player* player = select_player_by_target(get_target(), context.map, NULL, NULL, NULL);
	if (player)
		do_action( context.map, player );
}

void t_script_player_action::do_action( t_adventure_map* map, t_player* player ) const
{
}

